#include<iostream>
#include<string>
#include<set>
using namespace std;
// zdl:: 这都啊题有很多比较坑的的地方就是违禁词中有替代词汇的子串
set<string> v;
string re ="<censored>";
int main()
{
    int n; cin >> n;
    for (int i = 1; i <= n; i++) 
    {
        string s; cin >> s;
        v.insert(s);
    }
    int k; cin >> k;
    cin >> ws;
    string str; getline(cin, str);
    int cnt = 0;
    for (auto& ch : v)
    {
        int pos = 0;
        while (pos != -1)
        {
            pos = str.find(ch, pos);
            if (pos != -1)
            {
                str.replace(pos, ch.size(), re);
                cnt++;
                // cout << "cnt :" << cnt << endl;
                // cout << str << endl;
            }
        }
    }
    if (k <= cnt) 
    {
        cout << cnt << endl;
        cout << "He Xie Ni Quan Jia!" << endl;
    }
    else cout << str << endl;

    // cout << "cnt : " << cnt << endl;
    return 0;
}



// zdl:: 不要心急，遇到这样的情况最想想到的实现来模拟
